Skip to content

fix(durabletask): don't let resolved event-wait timers block implicit completion#1769

Open
javier-aliaga wants to merge 1 commit into
dapr:masterfrom
javier-aliaga:fix/implicit-completion-moot-event-timers
Open

fix(durabletask): don't let resolved event-wait timers block implicit completion#1769
javier-aliaga wants to merge 1 commit into
dapr:masterfrom
javier-aliaga:fix/implicit-completion-moot-event-timers

Conversation

@javier-aliaga

Copy link
Copy Markdown
Contributor

Description

When an orchestrator returns without calling ctx.complete(), the executor auto-completes only if no pending actions remain. Since #1733 every waitForExternalEvent emits a CreateTimer action, so when the final event arrives in the same work item as the completion that resumed the orchestrator, the re-armed wait's timer is still pending when the function returns — blocking the implicit completion. The workflow stayed RUNNING until that timer fired: forever, for indefinite waits.

Treat pending timers of already-resolved event waits as moot in the implicit-completion check. All other pending actions block completion as before.

The regression test reconstructs the failing production history field-for-field.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

… completion

When an orchestrator returns without calling ctx.complete(), the executor
auto-completes only if no pending actions remain. Since dapr#1733 every
waitForExternalEvent emits a CreateTimer action, so when the final event
arrives in the same work item as the completion that resumed the
orchestrator, the re-armed wait's timer is still pending when the function
returns — blocking the implicit completion. The workflow stayed RUNNING
until that timer fired: forever, for indefinite waits.

Treat pending timers of already-resolved event waits as obsolete in the
implicit-completion check. All other pending actions block completion as
before.

The regression test reconstructs the failing production history
field-for-field.

Signed-off-by: Javier Aliaga <javier@diagrid.io>
@javier-aliaga javier-aliaga force-pushed the fix/implicit-completion-moot-event-timers branch from 377b7d7 to 16499a7 Compare June 12, 2026 15:17
@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.86%. Comparing base (38f13b9) to head (16499a7).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1769      +/-   ##
============================================
+ Coverage     76.83%   76.86%   +0.02%     
- Complexity     2297     2298       +1     
============================================
  Files           243      243              
  Lines          7141     7141              
  Branches        745      745              
============================================
+ Hits           5487     5489       +2     
+ Misses         1288     1287       -1     
+ Partials        366      365       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant